<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="js/jquery-1.11.3.js" type="text/javascript" charset="utf-8"></script>
<title>Insert title here</title>
	<script type="text/javascript">
		function ajaxGet() {
			// $.get(url, [data], [callback], [type])
			$.get(
				"/JAVA_WEB_1907/ajax",
				{"name":"zhangsan","age":23},
				function(data){
					alert("name:" + data.name + ",age" + data.age);
				},
				"json"
			);
		}
		
		function ajaxPost() {
			// $.get(url, [data], [callback], [type])
			$.post(
				"/JAVA_WEB_1907/ajax",
				{"name":"zhangsan","age":23},
				function(data){
					alert("name:" + data.name + ",age" + data.age);
				},
				"json"
			);
		}
		function ajax() {
			// $.ajax( { option1:value1,option2:value2... } ); 
			$.ajax({
				/* async : true, */
				url : "/JAVA_WEB_1907/ajax",
				data : {"name":"zhangsan","age":23},
				type : "post",
				dataType : "json",
				success : function(jsonObj) {
					// {"name":"zhangsan","age":23},
					alert("name:" + jsonObj.name + ",age" + jsonObj.age);
				}
			});
		}
	</script>
</head>
<body>	
	<button onclick="ajaxGet()">Ajax Get</button>
	<button onclick="ajaxPost()">Ajax Post</button>
	<button onclick="ajax()">Ajax</button>
</body>
</html>